package com.ecoolex.ying.space.ws;

import java.math.BigDecimal;
import java.util.List;

import com.ecoolex.framework.common.exception.BizException;
import com.ecoolex.framework.common.pojo.Page;
import com.ecoolex.framework.common.pojo.Pagination;
import com.ecoolex.framework.common.pojo.Sorting;
import com.ecoolex.ying.space.entity.OutsourcingGoodsWithBLOBs;
import com.ecoolex.ying.space.entity.OutsourcingPackaged;
import com.ecoolex.ying.space.entity.OutsourcingPackagedGoods;
import com.ecoolex.ying.space.entity.UserWorks;
import com.ecoolex.ying.space.entity.WholeHouseCase;
import com.ecoolex.ying.space.pojo.QueryOutsourcingGoodsAndPackagedDTO;
import com.ecoolex.ying.space.pojo.QueryWholeHouseCaseAndUserWorksDTO;

public interface OutsourcingGoodsService {

	OutsourcingGoodsWithBLOBs addOutsourcingGoods(OutsourcingGoodsWithBLOBs record,String createUser) throws BizException;
	
	OutsourcingGoodsWithBLOBs editOutsourcingGoods(OutsourcingGoodsWithBLOBs record,String updateUser) throws BizException;
	
	void deleteOutsourcingGoods(OutsourcingGoodsWithBLOBs record,String updateUser) throws BizException;
	
	void onlineOutsourcingGoods(OutsourcingGoodsWithBLOBs record,String updateUser) throws BizException;
	
	void offlineOutsourcingGoods(OutsourcingGoodsWithBLOBs record,String updateUser) throws BizException;
	
	boolean canOfflineOutsourcingGoods(Integer outsourcingGoodsId) throws BizException;
	
	OutsourcingGoodsWithBLOBs getOutsourcingGoodsById(Integer outsourcingGoodsId);
	
	Pagination<OutsourcingGoodsWithBLOBs> queryOutsourcingGoods(String name,Boolean online,Sorting[] sorts, Page page);
	
	OutsourcingPackaged addOutsourcingPackaged(OutsourcingPackaged record,List<Integer> outsourcingGoodsIds,String createUser) throws BizException;
	
	OutsourcingPackaged editOutsourcingPackaged(OutsourcingPackaged record,List<Integer> outsourcingGoodsIds,String updateUser) throws BizException;
	
	void deleteOutsourcingPackaged(OutsourcingPackaged record,String updateUser) throws BizException;
	
	void onlineOutsourcingPackaged(OutsourcingPackaged record,String updateUser) throws BizException;
	
	void offlineOutsourcingPackaged(OutsourcingPackaged record,String updateUser) throws BizException;
	
	OutsourcingPackaged getOutsourcingPackagedById(Integer outsourcingPackagedId);
	
	Pagination<OutsourcingPackaged> queryOutsourcingPackaged(String name,Boolean online,Sorting[] sorts, Page page);
	
	List<OutsourcingPackagedGoods> getOutsourcingPackagedGoodsByOutsourcingPackagedId(Integer OutsourcingPackagedId);
	
	Pagination<OutsourcingGoodsWithBLOBs> queryOutsourcingGoodsForH5(Integer categoryId,String name,Sorting[] sorts, Page page);
	
	OutsourcingGoodsWithBLOBs getOutsourcingGoodsByIdForH5(Integer outsourcingGoodsId);
	
	Pagination<OutsourcingPackaged> queryOutsourcingPackagedForH5(Sorting[] sorts, Page page);
	
	OutsourcingPackaged getOutsourcingPackagedByIdForH5(Integer outsourcingPackagedId);
	
	BigDecimal getTotalRetailPriceByPackagedId(Integer caseId);
	
	Pagination<QueryOutsourcingGoodsAndPackagedDTO> queryOutsourcingGoodsAndPackaged(String name,Page page);
	
	Pagination<OutsourcingPackaged> queryOutsourcingPackagedByGoodsId(Integer outsourcingGoodsId,Page page);

	List<QueryWholeHouseCaseAndUserWorksDTO> listByOutsourcingGoodsId(Integer outsourcingGoodsId,Integer size);

	Pagination<WholeHouseCase> queryWholeHouseCase(Integer outsourcingGoodsId,Page page);
	
	Pagination<UserWorks> queryUserWorks(Integer outsourcingGoodsId,Page page);
}
